import path from 'node:path'
import uni from '@dcloudio/vite-plugin-uni'
import reactivityTransform from '@vue-macros/reactivity-transform/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
    reactivityTransform(),
    AutoImport({
      imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
      dirs: ['src/stores/modules', 'src/hook', 'src/components'],
      dts: 'src/typings/auto-imports.d.ts',
    }),
  ],
  resolve: {
    alias: {
      '~/': `${path.resolve(__dirname, 'src')}/`,
      '@/': '/src/',
      '#/': '/src/typings/',
    },
  },
})
